<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <script src="js/swiper-4.2.6.min.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="css/swiper-4.2.6.min.css"/>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="js/public.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/font.js"></script>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/ui.css">
    <title></title>
    <!-- 发票管理-主页 -->
    <style>
    </style>
</head>
<body>
<div class="scroll-content2 invoice" style="overflow:auto;background: #f1f1f1;">
    <div class="top-public">
        <span class="public-center">发票管理</span>        
        <img src="images/left_icon.png" alt="" class="public-left">
    </div>
    <div class="header">
        <span class="title">可开发票总金额</span>
        <span class="totalAmount">￥<i class="amount">
            0.00
            <!--3000.00-->
        </i></span>
    </div>
    <div class="invoBar">
        <a href="invoiceAdmin.html" class="list">
            <img class="listIcon" src="images/icon_fapiao@2x.png"/>
            <span class="listName">申请发票</span>
        </a>
        <a href="invoiceTitle.html" class="list">
            <img class="listIcon" src="images/icon_taitou@2x.png"/>
            <span class="listName">发票抬头</span>
        </a>
        <a href="invoiceAddress.html" class="list">
            <img class="listIcon" src="images/icon_dizhi@2x.png"/>
            <span class="listName">邮寄地址</span>
        </a>
    </div>
    <div class="invoCon">
        <div class="invoTitle">
            近期发票
        </div>
        <div class="invoList">
            <!--<div class="order-list">-->
                <!--<div class="list-top">-->
                    <!--<span class="name">展示类网站</span> -->
                <!--</div>-->
                <!--<div class="list-center">-->
                    <!--<span class="price">￥100000.00</span>-->
                    <!--<span class="type">| 新购</span>-->
                <!--</div>-->
                <!--<div class="list-bot">下单时间：<span>2018-09-11 14:54:32</span></div>-->
                <!--<div class="finish">已开票</div>-->
            <!--</div>-->
            <!--<div class="order-list">-->
                <!--<div class="list-top">-->
                    <!--<span class="name">展示类网站</span>-->
                <!--</div>-->
                <!--<div class="list-center">-->
                    <!--<span class="price">￥100000.00</span>-->
                    <!--<span class="type">| 新购</span>-->
                <!--</div>-->
                <!--<div class="list-bot">下单时间：<span>2018-09-11 14:54:32</span></div>-->
                <!--<div class="finish">已开票</div>-->
            <!--</div>-->
        </div>
    </div>
    <div class="invoNone">
        <img src="images/image1@2x.png"/>
        <span>您还没有开票历史</span>
    </div>
</div>
</body>
<script>
    $(function(){
        //验证是否登陆
        var user_id = sessionStorage.getItem('userId');
        if (user_id == null) {
            alert('请先登录！');
            window.location.href = 'login.html';
        }
        sessionStorage.removeItem('invoceId');
        //获取抬头
        getTotal();
    });
    function getTotal() {
        var user_id = sessionStorage.getItem('userId');
        $.ajax({
            url: url() + 'api/Invoice/invoiceTotal',    //请求的url地址
            dataType: "JSON",   //返回格式为json
            async: true,//请求是否异步，默认为异步，这也是ajax重要特性
            type: "POST",   //请求方式
            data: {
                user_id:user_id,
            },
            success: function (data) {
                // console.log(data);
                var html = '';
                // 请求成功时处理
                if(data.status==1){
                    html = data.result.goods_price;
                    $('.amount').html(html);
                } else {
                    console.log(data);
                }

            }
        });
    }
</script>
<script>
$('.public-left').click(function(){
    // window.history.go(-1);
    window.location.href = 'my_costcenter.html';
})
//判断里面有没有开票历史
var invoList=$('.invoList').children().length;
if(invoList<=0){
    $('.invoCon').hide();
    $('.invoNone').show()
}
</script>
</html> 




